package com.hcrazy.manchester.app.utils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Constant {
	
	/**
	 * 浏览设置记录（针对不同的模块：topic、rent、secondary）
	 * @author Hsmart
	 *
	 */
	public static class Views{
		private String module;
		private long id;
		private List<String> remoteIps = new ArrayList<String>();
		public String getModule() {
			return module;
		}
		public void setModule(String module) {
			this.module = module;
		}
		public long getId() {
			return id;
		}
		public void setId(long id) {
			this.id = id;
		}
		public List<String> getRemoteIps() {
			return remoteIps;
		}
		public void setRemoteIps(List<String> remoteIps) {
			this.remoteIps = remoteIps;
		}
	}
	
	public static Map<String,List<Views>> OneDayViews = new HashMap<String,List<Views>>();
	
	public final static String SET_VIEWS_ERROR = "6000";//设置浏览数失败
	
	/**
	 * 测试main函数
	 * @param args
	 */
	public  static void main(String[] args){
		System.out.println(System.currentTimeMillis()/1000);
	}

	/**
	 * 全局常量
	 */
	
	public final static String SINGLE_RETURN = "value";
	
	public final static String SUCCESS = "success";
	
	public final static String FAILED = "failed";
	
	public final static String SESSION_VALIDATE_CODE = "validateCode";

	public final static int LOGIN_RESULT_SUCCESS = 1;
	
	public final static int LOGIN_RESULT_USERNAME_FAILED = 2;
	
	public final static int LOGIN_RESULT_PASSWORD_FAILED = 3;
	
	public final static int LOGIN_RESULT_VALIDATECODE_FAILED = 4;
	
	public final static String ERROR_CODE_NO_OBJECT = "000";
	
	public final static String ERROR_CODE_EXIST_NAME = "001";
	
	public final static String ERROR_CODE_EXIST_EMAIL = "002";
	
	public final static String ERROR_CODE_EXIST_CARD = "006";
	
	public final static String ERROR_CODE_EXIST_PHONE = "007";
	
	public final static String ERROR_CODE_EMPTY_NAME = "003";
	
	public final static String ERROR_CODE_EMPTY_PASSWORD = "004";
	
	public final static String ERROR_CODE_ERROR_PASSWORD = "005";
	
	public final static String ERROR_CODE_DATABASE = "100";
	
	public final static String ERROR_CODE_SYSTEM_EXCEPTION = "1001";
	
	public final static int USER_ACTIVED_YES = 1;
	
	public final static int USER_ACTIVED_NO = 0;
	
	/*************************分类码*******************************/
	public final static int TYPE_LIVE = 0;//生活信息分类
	public final static int TYPE_FUNC = 1;//实用功能分类
	public final static int TYPE_FACULTY = 2;//院系、专业分类
	
	
	public final static int TYPE_FUNC_RENT = 1;
	public final static int TYPE_FUNC_SECONDARY = 2;
	
	public final static int TYPE_FORUM = 0;
	public final static int TYPE_GROUP = 1;
	
	/**************************功能码*******************************/
	public final static int FUN_CODE_COMMON = 1;
	public final static int FUN_CODE_ADDRESS = 2;
	public final static int FUN_CODE_SIMPLE = 3;
	public final static int FUN_CODE_BALL = 4;
	
	/*************************域名**********************************/
	public final static String DOMAIN = "http://localhost:8080";
	
	/*************************注册形式**********************************/
	public final static int REGISTER_BY_PHONE = 2;
	public final static int REGISTER_BY_EMAIL = 1;
	public final static int REGISTER_BY_COMMON = 0;//无邮箱验证，无手机验证
	
	/*************************会员级别**********************************/
	public final static int MEMBER_LEVEL_0 = 0;//普通会员
	
	
	
	/*************************会员session errorcode**********************************/
	public final static String MEMBER_LOGIN_NOT = "2000";//会员未登录
	
	/*************************会员注册errorcode**********************************/
	public final static String MEMBER_REGISTER_VALIDATECODE = "2001";//验证码错误
	public final static String MEMBER_REGISTER_EMAIL_NULL = "2002";//邮箱为空
	public final static String MEMBER_REGISTER_PHONE_NULL = "2003";//手机为空
	public final static String MEMBER_REGISTER_PASSWORD_NULL = "2004";//密码为空
	public final static String MEMBER_REGISTER_USERNAME_NULL = "2005";//昵称为空
	
	public final static String MEMBER_REGISTER_EMAIL_INVALIDE = "2006";//邮箱验证错误
	public final static String MEMBER_REGISTER_PHONE_INVALIDE = "2007";//手机验证错误
	public final static String MEMBER_REGISTER_EMAIL_EXIST = "2008";//该邮箱已经被占用
	public final static String MEMBER_REGISTER_PHONE_EXIST = "2009";//该手机号已经被占用
	public final static String MEMBER_REGISTER_USERNAME_EXIST = "2010";//用户名已存在
	
	/*************************会员登录errorcode**********************************/
	public final static String MEMBER_LOGIN_USERNAME_NULL = "2100";//用户名为空
	public final static String MEMBER_LOGIN_PASSWORD_NULL = "2101";//密码为空
	public final static String MEMBER_LOGIN_USER_NOT_EXIST = "2102";//用户不存在
	public final static String MEMBER_LOGIN_PASSWORD_ERROR = "2103";//用户密码错误
	
	
	/*************************会员类型**********************************/
	public final static int MEMBER_TYPE_COMMON = 0;//普通会员
	public final static int MEMBER_TYPE_SELLER = 1;//商家会员
	
	/*************************邮箱匹配正则表达式**********************************/
	public final static String EMAIL_PATTERN = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
	public final static String PHONE_PATTERN = "^[1]([3][0-9]{1}|59|58|88|89)[0-9]{8}$";
	
	/*************************Email 发送地址**********************************/
	public final static String EMAIL_URL = DOMAIN + "/accounts/register?confirmation=";
	
	
	/**
	 * 娱乐交友部分：曼大BBS
	 */
	
	public final static int FORUM_TYPE_MODULE = 0;//论坛分区（下面包含论坛版块）
	public final static int FORUM_TYPE_FORUM = 1;//论坛版块（下面直接包含帖子）
	public final static int FORUM_TYPE_SUB = 2;//子论坛
	
	public final static int FORUM_STATUS_GROUP = 2;//群组
	public final static int FORUM_STATUS_NORMAL = 1;//正常
	public final static int FORUM_STATUS_HIDE = 0;//隐藏
	
	public final static int GROUP_JOINTYPE_CLOSE = -1;//关闭    加入方式
	public final static int GROUP_JOINTYPE_PUBLIC = 0;//公开
	public final static int GROUP_JOINTYPE_INVITE = 1;//邀请
	public final static int GROUP_JOINTYPE_APPLY = 2;//审核
	
	public final static int GROUP_VIEWPERM_MEMBER = 0;//公开
	public final static int GROUP_VIEWPERM_PUBLIC = 1;//仅成员   浏览权限
	
	public final static int POST_FIRST_YES = 1;//回帖第一条，即主题帖
	public final static int POST_FIRST_NO = 0;//非主题帖
	
	public final static int FORUM_TYPE_APPOINT_ID = 2;//“约”论坛版块
	
	public final static String FORUM_MODERATOR_ADD_USERNAME_NULL = "3001";//添加版主时不存在的用户名
	
	/**
	 * 娱乐交友部分：曼大BBS 发表主题
	 */
	public final static String TOPIC_NULL = "3101";//主题内容为空
	public final static String TOPIC_SUBJECT_NULL = "3102";//主题标题为空
	public final static String TOPIC_MESSAGE_NULL = "3103";//主题内容为空
	public final static String TOPIC_FORUMID_NULL = "3104";//主题所属论坛版块ID为空
	public final static String TOPIC_AUTHOR_NULL = "3105";//作者为空
	public final static String TOPIC_AUTHOR_ID_NULL = "3106";//用户id为空
	public final static String TOPIC_POSTDATE_NULL = "3107";//发表时间为空（秒数）
	public final static String TOPIC_USERIP_NULL = "3108";//客户端ip为空
	public final static String TOPIC_LASTPOST_NULL = "3109";//最后回复、编辑时间
	public final static String TOPIC_LASTPOSTER_NULL = "3110";//最后回帖作者为空
	
	/**
	 * 回帖
	 */
	public final static String POST_TOPIC_ID_NULL = "3200";//主题标识为空
	public final static String POST_MESSAGE_NULL = "3201";//回复内容为空
	public final static String POST_FORUM_ID_NULL = "3202";//所属论坛版块为空
	
	public final static int POST_ANONYMOUS_ALLOWED = 1;//允许匿名
	public final static int POST_ANONYMOUS_UN_ALLOWED = 0;//不允许匿名
	
	
	/**
	 * 主题批量设置选项
	 */
	public final static int TOPIC_BATCH_1 = 1;//批量移动版块
	public final static int TOPIC_BATCH_2 = 2;//批量置顶
	public final static int TOPIC_BATCH_3 = 3;//批量打开关闭
	public final static int TOPIC_BATCH_4 = 4;//批量删除
	public final static int TOPIC_BATCH_5 = 5;//批量设置精华
	
	
	public final static int TOPIC_DISPLAY_TYPE_0 = 0;//最新发表
	public final static int TOPIC_DISPLAY_TYPE_1 = 1;//最新回复
	public final static int TOPIC_DISPLAY_TYPE_2 = 2;//精华列表
	public final static int TOPIC_DISPLAY_TYPE_3 = 3;//置顶列表
	
	
	/**
	 * 房屋租赁
	 */
	public final static int RENT_TYPE_NONE = 0;//不限
	public final static int RENT_TYPE_ALL = 1;//整租
	public final static int RENT_TYPE_SINGLE = 2;//合租
	public final static int RENT_TYPE_SHORT = 3;//短租/日租
	
	public final static int HOUSE_TYPE_NONE = 0;
	public final static int HOUSE_TYPE_HOUSE = 1;
	public final static int HOUSE_TYPE_FLAT = 2;//Apartment
	public final static int HOUSE_TYPE_DORM = 3;//宿舍
	
	public final static int RENT_TIME_TYPE_NONE = 0;//不限
	public final static int RENT_TIME_TYPE_MONTH = 1;
	public final static int RENT_TIME_TYPE_YEAR = 2;
	public final static int RENT_TIME_TYPE_WEEK = 3;
	public final static int RENT_TIME_TYPE_DAY = 4;
	
	public final static int RENT_STATUS_NONE = 0;//不限
	public final static int RENT_STATUS_PERSON = 1;//个人发布
	public final static int RENT_STATUS_AGENT = 2;//经纪人发布
	
	public final static int RENT_ROOM_NONE = 0;//不限
	public final static int RENT_ROOM_MAINB = 1;//主卧
	public final static int RENT_ROOM_SUB = 2;//次卧
	
	public final static int RENT_GENDER_NONE = 0;//不限
	public final static int RENT_GENDER_MAIL = 1;//男
	public final static int RENT_GENDER_FEMAIL = 2;//女
	
	public final static int RENT_PRICE_1 = 1;//500以下
	public final static int RENT_PRICE_2 = 2;//500-1000
	public final static int RENT_PRICE_3 = 3;//1000-1500
	public final static int RENT_PRICE_4 = 4;//1500-2000
	public final static int RENT_PRICE_5 = 5;//2000-2500
	public final static int RENT_PRICE_6 = 6;//2500-3000
	public final static int RENT_PRICE_7 = 7;//3000-3500
	public final static int RENT_PRICE_8 = 8;//3500-4000
	public final static int RENT_PRICE_9 = 9;//4000以上
	
	public final static int RENT_ROOM_RANGE_1 = 1;//一室
	public final static int RENT_ROOM_RANGE_2 = 2;//二室
	public final static int RENT_ROOM_RANGE_3 = 3;//三室
	public final static int RENT_ROOM_RANGE_4 = 4;//四室
	public final static int RENT_ROOM_RANGE_5 = 5;//四室以上
	
	public final static String UPLOAD_IMAGE_FAILED = "5000";
	
	public final static int SECON_PRICE_1 = 1;//100以下
	public final static int SECON_PRICE_2 = 2;//100-200
	public final static int SECON_PRICE_3 = 3;//200-500
	public final static int SECON_PRICE_4 = 4;//500-1000
	public final static int SECON_PRICE_5 = 5;//1000-2000
	public final static int SECON_PRICE_6 = 6;//2000-3500
	public final static int SECON_PRICE_7 = 7;//3500以上
	
	/**************************会员相关*******************************/
	
	public final static int USER_FRIEND_IRRELEVANT = -1;//好友无关（既不是好友，也不曾申请好友）
	public final static int USER_FRIEND_APPLY = 0;//好友申请
	public final static int USER_FRIEND_ALLOW = 1;//允许申请
	public final static int USER_FRIEND_REFUSE = 2;//拒绝申请
	
	public final static int GROUP_USER_APPLY = 0;//加入小组申请
	public final static int GROUP_USER_ALLOW = 1;//允许加入
	
	
	/**************************订餐系统*******************************/
	
	public final static int TYPE_BOOK_FOOD_MENU = 0;//订餐系统中菜单分类：订餐菜单
	public final static int TYPE_BOOK_TICKET = 1;//订餐系统中菜单分类:票务分类
	
	
	public final static int TYPE_BOOK_ORDER_ALL = -1;//全部
	public final static int TYPE_BOOK_ORDER_INPUT = 0;//创建订单（未发货）
	public final static int TYPE_BOOK_ORDER_COMPLETE = 1;//订单正在执行中（已发货）
	public final static int TYPE_BOOK_ORDER_INVALID = 2;//订单完成（已到货）
	public final static int TYPE_BOOK_ORDER_RUNNING = 3;//订单无效
	
	/**************************票务系统*******************************/
	
	public final static int TYPE_BOOK_FOOD = 0;//订餐系统中指菜品
	public final static int TYPE_TICKET = 1;//票务系统中指票务
	public final static int TYPE_COUPON = 2;//优惠券系统中，指优惠券分类
	public final static int TYPE_FORUM_APPOINT = 3;//约 类型分类
	
	public final static int INFO_HAS_DETAIL = 1;
	public final static int INFO_NO_DETAIL = 0;
	
	public final static int COUPON_TYPE_DAILY = 0;//日发行
	public final static int COUPON_TYPE_LIMIT = 1;//限量发行
	
	public final static int COUPON_STATUS_RECEIVE = 0;//已领取
	public final static int COUPON_STATUS_USE = 1;//已使用
	
	public final static int RENT_TYPE_FOR_RENT = 1;//求租
	public final static int RENT_TYPE_TO_RENT = 0;//出租
	
	
	/**
	 * 优惠券 errorcode
	 */
	public final static String COUPON_ERROR_CODE_RECEIVED = "4001";//已领取
	public final static String COUPON_ERROR_CODE_BAG_FULL = "4002";//卡包已满
	public final static String COUPON_ERROR_CODE_BY_PASSWORD = "4003";//凭密领取
	public final static String COUPON_ERROR_CODE_PASSWORD_ERROR = "4004";//密码错误
	
	public final static int RULE_TYPE_REGISTER = 1;//注册
	public final static int RULE_TYPE_TOPIC = 2;//发帖
	public final static int RULE_TYPE_REPLY = 3;//回帖
	public final static int RULE_TYPE_GOOD = 4;//加精
	public final static int RULE_TYPE_TOP = 5;//置顶 
	public final static int RULE_TYPE_ONLINE = 6;//在线时间
	
	public final static int BAG_S = 1;//卡包容量=BAG_S * 会员经验值
	
	/**
	 * 可评论、可收藏、可点赞模块标识
	 */
	
	public final static int COMM_ADDRESS_INFO_MODULE = 1;//地址类信息
	public final static int COMM_SIMPLE_INFO_MODULE = 2;//综合类信息
	public final static int COMM_SECONDARY_INFO_MODULE = 3;//二手交易
	public final static int COMM_RENT_INFO_MODULE = 4;//房屋出租
	public final static int COMM_TICKET_INFO_MODULE = 5;//票务
	public final static int COMM_COUPON_INFO_MODULE = 6;//优惠券
	public final static int COMM_BOOK_INFO_MODULE = 7;//订餐功能
	public final static int COMM_BBS_INFO_MODULE = 8;//论坛帖子
	
	/**
	 * 点赞规则错误
	 */
	public final static String ERROR_PRAISE_INNER_ONE_DAY = "5001";//一天之内只能点一次赞
	
	public final static int ADVERT_START = 1;
	public final static int ADVERT_INDEX = 2;
	public final static int ADVERT_LIST = 0;
	
	public final static int MESSAGE_TYPE_SYSTEM = 0;//系统消息-管理员发出
	public final static int MESSAGE_TYPE_SYSTEM_REMIND = 1;//系统消息-消息提醒-自动发出
	public final static int MESSAGE_TYPE_USER = 2;//私信消息-好友或非好友-会员间消息
	
	public final static int MESSAGE_STATUS_NORMAL = 0;//正常发出的消息
	public final static int MESSAGE_STATUS_DELETE = 1;//被用户删除的消息
	
	public final static int MORE_LINK_US_ID = 1;
	public final static int MORE_DECLARE_ID = 2;
	
	/**
	 * 生活信息分类大分类ID
	 */
	
	public final static int LIVE_SORT_ID_FOOD = 349;//我是吃货
	
	public final static int NEWS_TYPE_NEWS = 1;//新闻
	public final static int NEWS_TYPE_REPORT = 2;//公告
	
	public final static int RADIO_TAG_RADIO = 1;
	
	public final static int RADIO_ID_CTYPE = 1;
	public final static int RADIO_ID_CSCENE = 2;
	public final static int RADIO_ID_CSTYLE = 3;
	
	/**
	 * 出租房屋的出租方式
	 */
	public final static int RENT_TYPE_ZHENGZU = 1;	//整租
	public final static int RENT_TYPE_HEZU = 2;		//合租
	public final static int RENT_TYPE_DUANZU = 3;	//短租
	public final static int RENT_TYPE_CHANGZU = 4;	//长租
	public final static int RENT_TYPE_ZHENG_DUANZU = 5;	//整短租
	public final static int RENT_TYPE_ZHENG_CHANGZU = 6;//整长租
	public final static int RENT_TYPE_HE_DUANZU = 7;	//合短租
	public final static int RENT_TYPE_HE_CHANGZU = 8;	//合长租
	
}
